package com.edfu.core.coursemgt.persistence.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="room_facilities")
public class RoomFacilitiesEntity implements ICourseMgtEntity {
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)	
	private long id;
	
	@ManyToOne
	@JoinColumn(name = "room_id", nullable = false)
	private RoomEntity room;
	
	@OneToMany(mappedBy = "room", fetch = FetchType.EAGER, cascade = CascadeType.ALL )
	private Set<FacilitiesEntity> facilities;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}

	public RoomEntity getRoom() {
		return room;
	}
	public void setRoom(RoomEntity room) {
		this.room = room;
	}

	public Set<FacilitiesEntity> getFacilities() {
		return facilities;
	}
	public void setFacilities(Set<FacilitiesEntity> facilities) {
		this.facilities = facilities;
	}
	
}
